<%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>文章预览</title>

    <!-- 引入Bootstrap CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">

    <!-- 自定义样式 -->
    <style>
        body {
            background-color: #f4f7fc;
            font-family: Arial, sans-serif;
            display: flex;
            min-height: 100vh;
            margin: 0;
        }

        /* 侧边栏样式 */
        .sidebar {
            width: 250px;
            background-color: #007bff;
            color: white;
            height: 100vh;
            position: fixed;
            top: 0;
            left: 0;
            padding-top: 20px;
            box-shadow: 2px 0px 5px rgba(0, 0, 0, 0.1);
        }

        .sidebar h2 {
            text-align: center;
            margin-bottom: 20px;
            font-size: 20px;
        }

        .sidebar a {
            display: block;
            padding: 12px;
            color: white;
            text-decoration: none;
            font-size: 16px;
        }

        .sidebar a:hover {
            background-color: #0056b3;
        }

        /* 页面主内容部分 */
        .main-content {
            margin-left: 250px;
            padding: 20px;
            flex-grow: 1;
        }

        h1 {
            text-align: center;
            margin-top: 20px;
            color: #343a40;
        }

        .article-content {
            background-color: white;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
            margin-top: 20px;
        }

        .article-content p {
            font-size: 1.1rem;
            line-height: 1.6;
        }

        .back-link {
            display: block;
            margin-top: 20px;
            text-align: center;
            font-size: 1.1rem;
            color: #007bff;
        }

        .back-link:hover {
            color: #0056b3;
        }
    </style>
</head>

<body>
<!-- 侧边栏 -->
<div class="sidebar">
    <h2>超级管理员控制台</h2>
    <a href="/superAdmin/achievementReview">科研成果审核</a>
    <a href="/superAdmin/users">用户管理</a>
    <a href="/superAdmin/permissions/management">权限管理</a>
    <a href="/superAdmin/articleReview">文章审核</a>
    <a href="/logout">退出登录</a>
</div>


<!-- 页面主内容 -->
<div class="main-content">
    <div class="container">
        <h1>文章预览</h1>

        <!-- 文章内容 -->
        <div class="article-content">
            <h2>${article.title}</h2>
            <p><strong>摘要：</strong>${article.abstractText}</p>
            <p><strong>内容：</strong>${article.content}</p>

            <p><strong>附件链接：</strong>
                <c:if test="${article.attachmentLink != null}">
                    <!-- 使用 URLEncoder 编码文件路径 -->
                    <a href="/download?filePath=${fn:escapeXml(article.attachmentLink)}">${article.attachmentLink}</a>
                </c:if>
            </p>
        </div>

        <!-- 返回审核页面链接 -->
        <a href="<c:url value='/superAdmin/articleReview'/>" class="back-link">返回文章审核</a>
    </div>
</div>

<!-- 引入Bootstrap JS 和依赖 -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
